import request from '@/utils/request'
export function getInstitution(query?: unknown) {
  return request({
    url: '/web/finance/institution/list',
    headers: {
      isToken: false,
    },
    method: 'get',
    params: query,
  })
}

export function addInstitution(data: unknown) {
  return request({
    url: '/manage/organization/appAdd',
    method: 'post',
    data,
  })
}
export function updateInstitutionUdp(data: unknown) {
  return request({
    url: '/manage/organization/appUdp',
    method: 'post',
    data,
  })
}
export function addInstitutionUser(data: unknown) {
  return request({
    url: '/system/user/addJgUser',
    method: 'post',
    data,
  })
}
export function updateInstitutionUser(data: unknown) {
  return request({
    url: '/system/user/udpJgUser',
    method: 'put',
    data,
  })
}

export function updateInstitution(data: unknown) {
  return request({
    url: '/web/finance/institution',
    method: 'put',
    data,
  })
}

export function deleteInstitution(id: string) {
  return request({
    url: `/web/finance/institution/${id}`,
    method: 'delete',
  })
}

export function manageOrganizations(query?: unknown) {
  return request({
    url: '/manage/organization/listOrganizationByUser',
    method: 'get',
    params: query,
  })
}

export function getInstitutionDetail(id: string) {
  return request({
    url: `/web/finance/institution/${id}`,
    headers: {
      isToken: false,
    },
    method: 'get',
  })
}
